import Vue from "vue";
import App from "./App.vue";
import VueRouter from "vue-router";
import Vant from "vant";
import "vant/lib/index.css";
import HmLogin from "./views/HmLogin.vue";
import HmHome from "./views/HmHome.vue";
import HmInterview from "./views/HmInterview.vue";
import HmCollect from "./views/HmCollect.vue";
import HmLike from "./views/HmLike.vue";
import HmMy from "./views/HmMy.vue";
import HmDetail from "./views/HmDetail.vue";
Vue.config.productionTip = false;

Vue.use(Vant);
Vue.use(VueRouter);
//创建路由对象
const router = new VueRouter({
  routes: [
    {
      path: "/",
      component: HmLogin,
    },
    {
      path: "/home",
      component: HmHome,
      children: [
        { path: "/home/interview", component: HmInterview },
        { path: "/home/collect", component: HmCollect },
        { path: "/home/like", component: HmLike },
        { path: "/home/my", component: HmMy },
      ],
    },
    {
      path: "/detail/:id",
      component: HmDetail,
    },
    {
      path: "/login",
      component: HmLogin,
    },
  ],
});
new Vue({
  render: (h) => h(App),
  router,
}).$mount("#app");
